
import java.io.FileInputStream;
import java.io.IOException;

class FDR{
	private static int read(String filename,byte[] data)
	{
		byte[] buff=new byte[1000000];
		int p=0;
		try{
			FileInputStream fin = new FileInputStream(filename);
			int size=fin.read(buff);			
			for(int i=0;i<size;i++)
			{
				char c=(char)buff[i];
				if(c=='X'||c=='0'||c=='1')
					data[p++]=buff[i];
			}
		}catch(IOException e){
			e.printStackTrace();
		}
		return p;
	}
	private static int code(byte[] data,int size){
		int[] Dic=new int[4096];
		int fdr = 0;
		for (int i = 0; i < size; i++)
		{
			int l = 0;
			while (i < size&&data[i] != '1')
			{
				i++;
				l++;
			}
			if (Dic[l] == 0)
			{
				int group = (int)(Math.ceil((Math.log(l + 3.0) / Math.log(2.0) - 1)));
				Dic[l] = group << 1;
			}
			fdr += Dic[l];
		}
		return fdr;
	}
	public static void main(String[] args)
	{
		if(args.length!=1)
			System.err.println("FDR filename");
		else{
			//long startTime=System.currentTimeMillis();
			byte[] data=new byte[1000000];
			int size=read(args[0],data);
			double r=1-code(data,size)/(double)size;
			System.out.printf("%.2f\n",r*100);
			//System.out.println(System.currentTimeMillis()-startTime);
		}
	}
}
	
